<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #div1{
            height: 500px;
            /* em：父元素的字体大小 */
            /* rem:参考根元素的大小 */
            width: 50vw;
            /* vm:对应窗口宽度 */
            /* vh:对应 */
            background: forestgreen;
        }
    </style>
</head>
<body>
    <div id="div1"></div>
</body>
</html>